package com.cskaoyan.day1.generic4;

import com.cskaoyan.day1.generic3.AutoCar;
import com.cskaoyan.day1.generic3.Truck;

/**
 * @author Common-zhou
 * @since 2023-02-27 10:06
 */
public class Holder3Demo {
    public static void main(String[] args) {
        testAutoCar();

        testTruck();
    }

    private static void testTruck() {
        Holder3<Truck> holder3 = new Holder3<>(new Truck());

        Truck truck = holder3.get();
        truck.run();
    }

    private static void testAutoCar() {

        Holder3<AutoCar> holder3 = new Holder3<>(new AutoCar());

        AutoCar autoCar = holder3.get();

        autoCar.run();
    }
}
